package com.wwj.springboot.controller;


import com.wwj.springboot.entity.CmfzAdmin;
import com.wwj.springboot.service.CmfzAdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;


/**
 * @author wwj
 */
@Controller
@RequestMapping("admin")
public class AdminController {


    @Autowired
    private CmfzAdminService cmfzAdminService;








    @RequestMapping("addAdmin")
    @ResponseBody
    public Map addAdmin(CmfzAdmin admin){
        return cmfzAdminService.addAdmin(admin);
    }

    @RequestMapping("selectByPage")
    @ResponseBody
    public Map selectByPage(int page,int limit,String username){
        return cmfzAdminService.selectByPage(page,limit,username);
    }

    @RequestMapping("updateAdmin")
    @ResponseBody
    public Map updateAdmin(CmfzAdmin admin){
        return cmfzAdminService.updateAdmin(admin);
    }
    @RequestMapping("selectOne")
    @ResponseBody
    public CmfzAdmin selectOne(int id){
        return cmfzAdminService.selectOne(id);
    }
    @RequestMapping("deleteAdmin")
    @ResponseBody
    public Map deleteAdmin(int id){
        return cmfzAdminService.deleteAdmin(id);
    }






}
